﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace pyTivoMetadataManager
{
    public partial class AddPersonForm : Form
    {
        MainForm _mainForm;
        public AddPersonForm(MainForm mainForm)
        {
            InitializeComponent();
            _mainForm = mainForm;
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnAdd_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(txtName.Text) && cboType.SelectedItem != null)
            {
                _mainForm.AddPerson(txtName.Text, cboType.SelectedItem.ToString().Replace(" ", ""));
            }
            this.Close();
        }

        private void AddPersonForm_Load(object sender, EventArgs e)
        {
            cboType.SelectedItem = "Actor";
        }
    }
}
